--
vim.o.guifont = "MesloLGS Nerd Font Mono:h15"
vim.g.neovide_input_macos_alt_is_meta = true
vim.g.neovide_remember_window_size = true
-- vim.g.neovide_show_border = true
vim.g.neovide_cursor_animation_length = 0
vim.g.neovide_cursor_antialiasing = true
vim.g.neovide_scroll_animation_length = 0.1
vim.g.neovide_scroll_animation_far_lines = 0
vim.g.neovide_remember_window_size = true
vim.g.neovide_refresh_rate = 60
vim.g.neovide_refresh_rate_idle = 5
if vim.g.transparent_background then
  vim.g.neovide_transparency = 0.0
  vim.g.transparency = 0.9
  local alpha = function() return string.format("%x", math.floor((255 * vim.g.transparency) or 0.8)) end
  vim.g.neovide_background_color = "#0f1117" .. alpha()
end
local function set_ime(args)
  if args.event:match "Enter$" then
    vim.g.neovide_input_ime = true
  else
    vim.g.neovide_input_ime = false
  end
end
local ime_input = vim.api.nvim_create_augroup("ime_input", { clear = true })

vim.api.nvim_create_autocmd({ "InsertEnter", "InsertLeave" }, {
  group = ime_input,
  pattern = "*",
  callback = set_ime,
})

vim.api.nvim_create_autocmd({ "CmdlineEnter", "CmdlineLeave" }, {
  group = ime_input,
  pattern = "[/\\?]",
  callback = set_ime,
})
